from django.db import models


class CreditScoreDetail(models.Model):
    order_number = models.CharField(max_length=64, null=True, verbose_name='申请单号')
    user_id = models.IntegerField(null=False, verbose_name='申请人')
    apply_type = models.CharField(max_length=16, null=False, verbose_name='申请类型 8为字符串， 01代表申请/扣分类型, 00000000:'
                                                                          '分别代表 实验成果, 竞赛奖励, 协助加工, 助教助研, 爽约, 未打扫, 耗材用量过多')
    reason = models.CharField(max_length=512, null=True, verbose_name='扣除理由')
    reject_reason = models.CharField(max_length=256, null=True, verbose_name='拒绝理由')
    picture_url = models.CharField(max_length=128, null=True, verbose_name='照片路径')
    status = models.IntegerField(null=False, verbose_name='状态 0-提交 1-待审批 2-已完成 4-拒绝 ')
    credit_score = models.IntegerField(null=False, verbose_name="信用分")
    to_user_id = models.IntegerField(null=True, verbose_name="被转让人")
    created_time = models.DateTimeField(auto_now_add=True, null=False, verbose_name='消息创建时间')
    updated_time = models.DateTimeField(auto_now_add=True, null=False, verbose_name='消息更新时间')

    class Meta:
        managed = False
        db_table = 'credit_score_detail'
        verbose_name = '信用分详情表'
